using System.Collections.Generic;
using System.Threading.Tasks;
using Admin.NET.Application.Entity;
using Admin.NET.Core;
using Furion.DependencyInjection;
using Furion.DynamicApiController;
using Microsoft.AspNetCore.Mvc;

namespace Admin.NET.Application.Service;

/// <summary>
/// 租户业务服务
/// </summary>
[ApiDescriptionSettings(new string[] { "租户业务服务" }, Order = 200)]
public class TenantBusinessService : IDynamicApiController, ITransient, IPrivateDependency
{
	private readonly SqlSugarRepository<TenantBusiness> _tenantBusinessRep;

	private readonly SqlSugarRepository<powerconsumptionrecord> _pow;

	private readonly SqlSugarRepository<Room> _room;

	public TenantBusinessService(SqlSugarRepository<TenantBusiness> businessRep)
	{
		_tenantBusinessRep = businessRep;
	}

	/// <summary>
	/// 增加租户业务数据
	/// </summary>
	/// <returns></returns>
	public async Task<bool> AddBusiness()
	{
		TenantBusiness tenantBusiness = new TenantBusiness
		{
			Name = "zuohuaijun"
		};
		return await _tenantBusinessRep.InsertAsync(tenantBusiness);
	}

	/// <summary>
	/// 查询租户业务数据
	/// </summary>
	/// <returns></returns>
	public async Task<List<TenantBusiness>> GetBusinessList()
	{
		return await _tenantBusinessRep.GetListAsync();
	}
}
